package com.management.dao;

import com.management.controller.info.MemberInfo;
import com.management.model.AccountRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 龙世超
 * @since 2022-03-23
 */
public interface AccountRoleDao extends BaseMapper<AccountRole> {

    @Select("SELECT\n" +
            "DISTINCT da.account_name,dr.role_name\n" +
            "FROM dm_account da JOIN\n" +
            "dm_account_role dar ON da.account_id=dar.account_id\n" +
            "JOIN dm_role dr ON dar.role_id=dr.role_num")
    List<MemberInfo> selectMembers();
}
